/*
package com.zijin.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("table")
@RestController
public class ListController {


    @Autowired
    private FormInfoService formInfoService;

    @GetMapping("list")
    public String list(Integer page, Integer limit, @RequestParam(value = "keyword", required = false) String keyword) throws JSONException {
        IPage<FormInfo> list = formInfoService.list(page, limit, keyword);

        JSONArray jsonArray = new JSONArray();
        for (FormInfo record : list.getRecords()) {
            JSONObject temp = new JSONObject();
            temp.put("id", record.getId());
            temp.put("userId", record.getUserId());
            temp.put("companyName", record.getCompanyName());
            jsonArray.put(temp);
        }

        JSONObject res = new JSONObject();
        res.put("code", 0);
        res.put("msg", "成功");
        res.put("count", list.getTotal());
        res.put("data", jsonArray);
        return res.toString();
    }

}
*/
